<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .p {
        width: 200px;
        height: 200px;
        background: red;
    }

    .c {
        width: 100px;
        height: 100px;
        background: deepskyblue;
    }
</style>

<body>
<div id="app">
    <div class="p" @click="handle1">
        <div class="c" @click.stop="handle2"></div>
    </div>
    <a href="http://chst.vip" @click.prevent="handle3">点击</a>
</div>
</body>

</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
<script>

    //stop:阻止冒泡
    //prevent:阻止默认行为
    //native:触发原生事件(vue2,vue3没有这个修饰符)

    let vm = new Vue({
        data: {
            food: '🥕胡萝卜',
            hobby: '打🏀'
        },
        methods: {
            handle1() {
                alert('1')
            },
            handle2() {
                alert('2')
            },
            handle3() {
                alert('3')
            }
        }
    }).$mount('#app')
</script>